<template>
    <div style="width: 500px; margin-left: 500px">
      <div style="text-align: center; margin:10px">贷款申请表</div>
      <el-form ref="form" :model="form" label-width="110px">
        <el-form-item label="申请人姓名">
          <el-input v-model="form.applyUserName"></el-input>
        </el-form-item>
        <el-form-item label="申请人身份证号">
          <el-input v-model="form.idCard"></el-input>
        </el-form-item>
        <el-form-item label="申请人职业">
          <el-input v-model="form.job"></el-input>
        </el-form-item>
        <el-form-item label="申请人电话">
          <el-input v-model="form.phone"></el-input>
        </el-form-item>
        <el-form-item label="申请人住址">
          <el-input v-model="form.address"></el-input>
        </el-form-item>
        <el-form-item label="申请贷款额度">
          <el-input v-model="form.loadAmount"></el-input>
        </el-form-item>
        <el-form-item label="贷款用途">
          <el-input v-model="form.loadPurpose"></el-input>
        </el-form-item>
        <el-form-item label="贷款期限">
          <el-input v-model="form.loadLimitDate"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" style="margin-left: 100px" @click="submit">提交申请</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
  import { applyLoan } from '@/api/loanInfo'
  export default {
    data() {
      return {
        form: {
          applyUserName: '',
          idCard: '',
          job: '',
          phone: '',
          loadAmount: '',
          loadPurpose: '',
          loadLimitDate: '',
        }
      }
    },
    methods: {
      submit() {
        applyLoan(this.form).then(res => {
          if(res.code === 200){
            alert("申请流程审核中.......")
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
